/*
 * Class32_Sub1 - Decompiled by JODE
 * Visit http://jode.sourceforge.net/
 */
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;
import java.util.zip.CRC32;
import java.util.zip.GZIPInputStream;

public class Class32_Sub1 extends Class32 implements Runnable {
	private int anInt1334;
	private byte[] aByteArray1335;
	private int[] anIntArray1336;
	private byte[][] aByteArrayArray1337 = new byte[4][];
	private boolean aBoolean1338 = false;
	private boolean aBoolean1339 = true;
	private Deque aDeque_1340 = new Deque(true);
	private int anInt1341;
	private int anInt1342;
	private int anInt1343;
	private int[][] anIntArrayArray1344 = new int[4][];
	private int anInt1345;
	private int[] anIntArray1346;
	public String aString1347 = "";
	public int anInt1348;
	private OutputStream anOutputStream1349;
	public int anInt1350;
	private Deque aDeque_1351 = new Deque(true);
	private boolean aBoolean1352 = false;
	private int anInt1353;
	private CRC32 aCRC32_1354 = new CRC32();
	private Socket aSocket1355;
	private boolean aBoolean1356 = false;
	private Deque aDeque_1357 = new Deque(true);
	private Deque aDeque_1358 = new Deque(true);
	private byte[] aByteArray1359 = new byte[65000];
	private int[] anIntArray1360;
	private int anInt1361;
	private int anInt1362;
	private int anInt1363;
	private byte[] aByteArray1364 = new byte[500];
	private int[] anIntArray1365;
	private int[] anIntArray1366;
	private int anInt1367 = 591;
	private int anInt1368;
	private Class9 aClass9_1369 = new Class9(true);
	private InputStream anInputStream1370;
	private byte aByte1371 = 6;
	private Class50_Sub1_Sub3 aClass50_Sub1_Sub3_1372;
	private Client aClient1373;
	private Deque aDeque_1374 = new Deque(true);
	private int anInt1375;
	private int[] anIntArray1376;
	private int[][] anIntArrayArray1377 = new int[4][];
	private long aLong1378;
	public int anInt1379;
	private boolean aBoolean1380 = false;

	private final void method324(boolean bool) {
		if (bool) {
			anInt1368 = 138;
		}
		do {
			try {
				int i = anInputStream1370.available();
				if (anInt1362 == 0 && i >= 6) {
					aBoolean1338 = true;
					for (int i_0_ = 0; i_0_ < 6; i_0_ += anInputStream1370.read(aByteArray1364,
						i_0_, 6 - i_0_)) {
						/* empty */
					}
					int i_1_ = aByteArray1364[0] & 0xff;
					int i_2_ = (((aByteArray1364[1] & 0xff) << 8) + (aByteArray1364[2] & 0xff));
					int i_3_ = (((aByteArray1364[3] & 0xff) << 8) + (aByteArray1364[4] & 0xff));
					int i_4_ = aByteArray1364[5] & 0xff;
					aClass50_Sub1_Sub3_1372 = null;
					for (Class50_Sub1_Sub3 class50_sub1_sub3 = (Class50_Sub1_Sub3) aDeque_1374
						.method158(); class50_sub1_sub3 != null; class50_sub1_sub3 = (Class50_Sub1_Sub3) aDeque_1374
						.method160(1)) {
						if (((class50_sub1_sub3).anInt1467 == i_1_)
							&& ((class50_sub1_sub3).anInt1468) == i_2_) {
							aClass50_Sub1_Sub3_1372 = class50_sub1_sub3;
						}
						if (aClass50_Sub1_Sub3_1372 != null) {
							(class50_sub1_sub3).anInt1469 = 0;
						}
					}
					if (aClass50_Sub1_Sub3_1372 != null) {
						anInt1353 = 0;
						if (i_3_ == 0) {
							Signlink.reporterror("Rej: " + i_1_ + "," + i_2_);
							(aClass50_Sub1_Sub3_1372).aByteArray1470 = null;
							if ((aClass50_Sub1_Sub3_1372).aBoolean1471) {
								synchronized (aDeque_1357) {
									aDeque_1357.method155(aClass50_Sub1_Sub3_1372);
								}
							} else {
								aClass50_Sub1_Sub3_1372.method453();
							}
							aClass50_Sub1_Sub3_1372 = null;
						} else {
							if (((aClass50_Sub1_Sub3_1372).aByteArray1470) == null && i_4_ == 0) {
								(aClass50_Sub1_Sub3_1372).aByteArray1470 = new byte[i_3_];
							}
							if (((aClass50_Sub1_Sub3_1372).aByteArray1470) == null && i_4_ != 0) {
								throw new IOException("missing start of file");
							}
						}
					}
					anInt1361 = i_4_ * 500;
					anInt1362 = 500;
					if (anInt1362 > i_3_ - i_4_ * 500) {
						anInt1362 = i_3_ - i_4_ * 500;
					}
				}
				if (anInt1362 <= 0 || i < anInt1362) {
					break;
				}
				aBoolean1338 = true;
				byte[] is = aByteArray1364;
				int i_5_ = 0;
				if (aClass50_Sub1_Sub3_1372 != null) {
					is = ((aClass50_Sub1_Sub3_1372).aByteArray1470);
					i_5_ = anInt1361;
				}
				for (int i_6_ = 0; i_6_ < anInt1362; i_6_ += anInputStream1370.read(is,
					i_6_ + i_5_, anInt1362 - i_6_)) {
					/* empty */
				}
				if (anInt1362 + anInt1361 >= is.length && aClass50_Sub1_Sub3_1372 != null) {
					if ((aClient1373).aCacheIndexArray1228[0] != null) {
						(aClient1373).aCacheIndexArray1228[((aClass50_Sub1_Sub3_1372).anInt1467) + 1]
							.method293(is.length, true, is, ((aClass50_Sub1_Sub3_1372).anInt1468));
					}
					if (!((aClass50_Sub1_Sub3_1372).aBoolean1471)
						&& ((aClass50_Sub1_Sub3_1372).anInt1467) == 3) {
						(aClass50_Sub1_Sub3_1372).aBoolean1471 = true;
						(aClass50_Sub1_Sub3_1372).anInt1467 = 93;
					}
					if ((aClass50_Sub1_Sub3_1372).aBoolean1471) {
						synchronized (aDeque_1357) {
							aDeque_1357.method155(aClass50_Sub1_Sub3_1372);
						}
					} else {
						aClass50_Sub1_Sub3_1372.method453();
					}
				}
				anInt1362 = 0;
			} catch (IOException ioexception) {
				try {
					aSocket1355.close();
				} catch (Exception exception) {
					/* empty */
				}
				aSocket1355 = null;
				anInputStream1370 = null;
				anOutputStream1349 = null;
				anInt1362 = 0;
			}
			break;
		} while (false);
	}

	public final int method325(int i, int i_7_) {
		if (i_7_ >= 0) {
			return anInt1367;
		}
		return aByteArray1335[i] & 0xff;
	}

	@Override
	public final void method323(int i) {
		method329(0, i);
	}

	private final void method326(int i) {
		if (i == 0) {
			while_13_: do {
				for (;;) {
					if (anInt1342 != 0) {
						break while_13_;
					}
					if (anInt1343 >= 10) {
						break;
					}
					if (anInt1341 == 0) {
						break;
					}
					Class50_Sub1_Sub3 class50_sub1_sub3;
					synchronized (aDeque_1358) {
						class50_sub1_sub3 = (Class50_Sub1_Sub3) aDeque_1358.popFront();
					}
					while (class50_sub1_sub3 != null) {
						if ((aByteArrayArray1337[((class50_sub1_sub3).anInt1467)][((class50_sub1_sub3).anInt1468)]) != 0) {
							aByteArrayArray1337[((class50_sub1_sub3).anInt1467)][((class50_sub1_sub3).anInt1468)] = (byte) 0;
							aDeque_1374.method155(class50_sub1_sub3);
							method342(anInt1345, class50_sub1_sub3);
							aBoolean1338 = true;
							if (anInt1334 < anInt1350) {
								anInt1334++;
							}
							aString1347 = ("Loading extra files - " + anInt1334 * 100 / anInt1350 + "%");
							anInt1343++;
							if (anInt1343 == 10) {
								return;
							}
						}
						synchronized (aDeque_1358) {
							class50_sub1_sub3 = (Class50_Sub1_Sub3) aDeque_1358.popFront();
						}
					}
					for (int i_8_ = 0; i_8_ < 4; i_8_++) {
						byte[] is = aByteArrayArray1337[i_8_];
						int i_9_ = is.length;
						for (int i_10_ = 0; i_10_ < i_9_; i_10_++) {
							if (is[i_10_] == anInt1341) {
								is[i_10_] = (byte) 0;
								class50_sub1_sub3 = new Class50_Sub1_Sub3();
								(class50_sub1_sub3).anInt1467 = i_8_;
								(class50_sub1_sub3).anInt1468 = i_10_;
								(class50_sub1_sub3).aBoolean1471 = false;
								aDeque_1374.method155(class50_sub1_sub3);
								method342(anInt1345, class50_sub1_sub3);
								aBoolean1338 = true;
								if (anInt1334 < anInt1350) {
									anInt1334++;
								}
								aString1347 = ("Loading extra files - " + anInt1334 * 100
									/ anInt1350 + "%");
								anInt1343++;
								if (anInt1343 == 10) {
									return;
								}
							}
						}
					}
					anInt1341--;
				}
				break;
			} while (false);
		}
	}

	public final void method327(int i, int i_11_, byte i_12_, int i_13_) {
		if (i < 0 && (aClient1373).aCacheIndexArray1228[0] != null
			&& anIntArrayArray1377[i_11_][i_13_] != 0) {
			byte[] is = (aClient1373).aCacheIndexArray1228[i_11_ + 1].method292(aByte1371, i_13_);
			if (!method341(is, 764, anIntArrayArray1377[i_11_][i_13_],
				anIntArrayArray1344[i_11_][i_13_])) {
				aByteArrayArray1337[i_11_][i_13_] = i_12_;
				if (i_12_ > anInt1341) {
					anInt1341 = i_12_;
				}
				anInt1350++;
			}
		}
	}

	public final boolean method328(int i, boolean bool) {
		if (!bool) {
			throw new NullPointerException();
		}
		if (anIntArray1366[i] == 1) {
			return true;
		}
		return false;
	}

	public final void method329(int i, int i_14_) {
		if (i >= 0 && i <= anIntArrayArray1377.length && i_14_ >= 0
			&& i_14_ <= anIntArrayArray1377[i].length && anIntArrayArray1377[i][i_14_] != 0) {
			synchronized (aClass9_1369) {
				for (Class50_Sub1_Sub3 class50_sub1_sub3 = (Class50_Sub1_Sub3) aClass9_1369
					.method187(); class50_sub1_sub3 != null; class50_sub1_sub3 = (Class50_Sub1_Sub3) aClass9_1369
					.method188(1)) {
					if ((class50_sub1_sub3).anInt1467 == i
						&& ((class50_sub1_sub3).anInt1468 == i_14_)) {
						return;
					}
				}
				Class50_Sub1_Sub3 class50_sub1_sub3 = new Class50_Sub1_Sub3();
				(class50_sub1_sub3).anInt1467 = i;
				(class50_sub1_sub3).anInt1468 = i_14_;
				(class50_sub1_sub3).aBoolean1471 = true;
				synchronized (aDeque_1340) {
					aDeque_1340.method155(class50_sub1_sub3);
				}
				aClass9_1369.method185(class50_sub1_sub3);
			}
		}
	}

	public final Class50_Sub1_Sub3 method330() {
		Class50_Sub1_Sub3 class50_sub1_sub3;
		synchronized (aDeque_1357) {
			class50_sub1_sub3 = (Class50_Sub1_Sub3) aDeque_1357.popFront();
		}
		if (class50_sub1_sub3 == null) {
			return null;
		}
		synchronized (aClass9_1369) {
			class50_sub1_sub3.method454();
		}
		if ((class50_sub1_sub3).aByteArray1470 == null) {
			return class50_sub1_sub3;
		}
		int i = 0;
		try {
			GZIPInputStream gzipinputstream = new GZIPInputStream(new ByteArrayInputStream(
				(class50_sub1_sub3).aByteArray1470));
			for (;;) {
				if (i == aByteArray1359.length) {
					throw new RuntimeException("buffer overflow!");
				}
				int i_15_ = gzipinputstream.read(aByteArray1359, i, aByteArray1359.length - i);
				if (i_15_ == -1) {
					break;
				}
				i += i_15_;
			}
		} catch (IOException ioexception) {
			throw new RuntimeException("error unzipping");
		}
		(class50_sub1_sub3).aByteArray1470 = new byte[i];
		for (int i_16_ = 0; i_16_ < i; i_16_++) {
			(class50_sub1_sub3).aByteArray1470[i_16_] = aByteArray1359[i_16_];
		}
		return class50_sub1_sub3;
	}

	@Override
	public final void run() {
		try {
			while (aBoolean1339) {
				anInt1348++;
				int i = 20;
				if (anInt1341 == 0 && (aClient1373).aCacheIndexArray1228[0] != null) {
					i = 50;
				}
				try {
					Thread.sleep(i);
				} catch (Exception exception) {
					/* empty */
				}
				aBoolean1338 = true;
				for (int i_17_ = 0; i_17_ < 100; i_17_++) {
					if (!aBoolean1338) {
						break;
					}
					aBoolean1338 = false;
					method338(true);
					method331(0);
					if (anInt1342 == 0 && i_17_ >= 5) {
						break;
					}
					method326(0);
					if (anInputStream1370 != null) {
						method324(false);
					}
				}
				boolean bool = false;
				for (Class50_Sub1_Sub3 class50_sub1_sub3 = (Class50_Sub1_Sub3) aDeque_1374
					.method158(); class50_sub1_sub3 != null; class50_sub1_sub3 = (Class50_Sub1_Sub3) aDeque_1374
					.method160(1)) {
					if ((class50_sub1_sub3).aBoolean1471) {
						bool = true;
						(class50_sub1_sub3).anInt1469++;
						if ((class50_sub1_sub3).anInt1469 > 50) {
							(class50_sub1_sub3).anInt1469 = 0;
							method342(anInt1345, class50_sub1_sub3);
						}
					}
				}
				if (!bool) {
					for (Class50_Sub1_Sub3 class50_sub1_sub3 = (Class50_Sub1_Sub3) aDeque_1374
						.method158(); class50_sub1_sub3 != null; class50_sub1_sub3 = (Class50_Sub1_Sub3) aDeque_1374
						.method160(1)) {
						bool = true;
						(class50_sub1_sub3).anInt1469++;
						if ((class50_sub1_sub3).anInt1469 > 50) {
							(class50_sub1_sub3).anInt1469 = 0;
							method342(anInt1345, class50_sub1_sub3);
						}
					}
				}
				if (bool) {
					anInt1353++;
					if (anInt1353 > 750) {
						try {
							aSocket1355.close();
						} catch (Exception exception) {
							/* empty */
						}
						aSocket1355 = null;
						anInputStream1370 = null;
						anOutputStream1349 = null;
						anInt1362 = 0;
					}
				} else {
					anInt1353 = 0;
					aString1347 = "";
				}
				if (aClient1373.aBoolean1137 && aSocket1355 != null && anOutputStream1349 != null
					&& (anInt1341 > 0 || ((aClient1373).aCacheIndexArray1228[0] == null))) {
					anInt1375++;
					if (anInt1375 > 500) {
						anInt1375 = 0;
						aByteArray1364[0] = (byte) 0;
						aByteArray1364[1] = (byte) 0;
						aByteArray1364[2] = (byte) 0;
						aByteArray1364[3] = (byte) 10;
						try {
							anOutputStream1349.write(aByteArray1364, 0, 4);
						} catch (IOException ioexception) {
							anInt1353 = 5000;
						}
					}
				}
			}
		} catch (Exception exception) {
			Signlink.reporterror("od_ex " + exception.getMessage());
		}
	}

	private final void method331(int i) {
		anInt1342 = 0;
		anInt1343 = 0;
		if (i == 0) {
			for (Class50_Sub1_Sub3 class50_sub1_sub3 = (Class50_Sub1_Sub3) aDeque_1374.method158(); class50_sub1_sub3 != null; class50_sub1_sub3 = (Class50_Sub1_Sub3) aDeque_1374
				.method160(1)) {
				if ((class50_sub1_sub3).aBoolean1471) {
					anInt1342++;
				} else {
					anInt1343++;
				}
			}
			while (anInt1342 < 10) {
				Class50_Sub1_Sub3 class50_sub1_sub3 = (Class50_Sub1_Sub3) aDeque_1351.popFront();
				if (class50_sub1_sub3 == null) {
					break;
				}
				if ((aByteArrayArray1337[(class50_sub1_sub3).anInt1467][(class50_sub1_sub3).anInt1468]) != 0) {
					anInt1334++;
				}
				aByteArrayArray1337[(class50_sub1_sub3).anInt1467][(class50_sub1_sub3).anInt1468] = (byte) 0;
				aDeque_1374.method155(class50_sub1_sub3);
				anInt1342++;
				method342(anInt1345, class50_sub1_sub3);
				aBoolean1338 = true;
			}
		}
	}

	public final void method332(boolean bool, byte i) {
		if (i != 109) {
			aBoolean1352 = !aBoolean1352;
		}
		int i_18_ = anIntArray1346.length;
		for (int i_19_ = 0; i_19_ < i_18_; i_19_++) {
			if (bool || anIntArray1336[i_19_] != 0) {
				method327(-44, 3, (byte) 2, anIntArray1365[i_19_]);
				method327(-44, 3, (byte) 2, anIntArray1360[i_19_]);
			}
		}
	}

	public final int method333() {
		synchronized (aClass9_1369) {
			return aClass9_1369.method189();
		}
	}

	public final boolean method334(int i, boolean bool) {
		for (int i_20_ = 0; i_20_ < anIntArray1346.length; i_20_++) {
			if (anIntArray1365[i_20_] == i) {
				return true;
			}
		}
		if (bool) {
			anInt1363 = -405;
		}
		return false;
	}

	public final void method335(Archive archive, Client client) {
		String[] strings = { "model_version", "anim_version", "midi_version", "map_version" };
		for (int i = 0; i < 4; i++) {
			byte[] is = archive.method154(strings[i], null);
			int i_21_ = is.length / 2;
			Packet packet = new Packet(is);
			anIntArrayArray1377[i] = new int[i_21_];
			aByteArrayArray1337[i] = new byte[i_21_];
			for (int i_22_ = 0; i_22_ < i_21_; i_22_++) {
				anIntArrayArray1377[i][i_22_] = packet.getUShort();
			}
		}
		String[] strings_23_ = { "model_crc", "anim_crc", "midi_crc", "map_crc" };
		for (int i = 0; i < 4; i++) {
			byte[] is = archive.method154(strings_23_[i], null);
			int i_24_ = is.length / 4;
			Packet packet = new Packet(is);
			anIntArrayArray1344[i] = new int[i_24_];
			for (int i_25_ = 0; i_25_ < i_24_; i_25_++) {
				anIntArrayArray1344[i][i_25_] = packet.getInt();
			}
		}
		byte[] is = archive.method154("model_index", null);
		int i = anIntArrayArray1377[0].length;
		aByteArray1335 = new byte[i];
		for (int i_26_ = 0; i_26_ < i; i_26_++) {
			if (i_26_ < is.length) {
				aByteArray1335[i_26_] = is[i_26_];
			} else {
				aByteArray1335[i_26_] = (byte) 0;
			}
		}
		is = archive.method154("map_index", null);
		Packet packet = new Packet(is);
		i = is.length / 7;
		anIntArray1346 = new int[i];
		anIntArray1360 = new int[i];
		anIntArray1365 = new int[i];
		anIntArray1336 = new int[i];
		for (int i_27_ = 0; i_27_ < i; i_27_++) {
			anIntArray1346[i_27_] = packet.getUShort();
			anIntArray1360[i_27_] = packet.getUShort();
			anIntArray1365[i_27_] = packet.getUShort();
			anIntArray1336[i_27_] = packet.getUByte();
		}
		is = archive.method154("anim_index", null);
		packet = new Packet(is);
		i = is.length / 2;
		anIntArray1376 = new int[i];
		for (int i_28_ = 0; i_28_ < i; i_28_++) {
			anIntArray1376[i_28_] = packet.getUShort();
		}
		is = archive.method154("midi_index", null);
		packet = new Packet(is);
		i = is.length;
		anIntArray1366 = new int[i];
		for (int i_29_ = 0; i_29_ < i; i_29_++) {
			anIntArray1366[i_29_] = packet.getUByte();
		}
		aClient1373 = client;
		aBoolean1339 = true;
		aClient1373.method12(this, 2);
	}

	public final void method336(byte i) {
		synchronized (aDeque_1358) {
			aDeque_1358.method162();
		}
		if (i != -125) {
			aBoolean1352 = !aBoolean1352;
		}
	}

	public final void method337(int i, int i_30_) {
		if ((aClient1373).aCacheIndexArray1228[0] != null && anIntArrayArray1377[i_30_][i] != 0
			&& aByteArrayArray1337[i_30_][i] != 0 && anInt1341 != 0) {
			Class50_Sub1_Sub3 class50_sub1_sub3 = new Class50_Sub1_Sub3();
			(class50_sub1_sub3).anInt1467 = i_30_;
			(class50_sub1_sub3).anInt1468 = i;
			(class50_sub1_sub3).aBoolean1471 = false;
			synchronized (aDeque_1358) {
				aDeque_1358.method155(class50_sub1_sub3);
			}
		}
	}

	private final void method338(boolean bool) {
		Class50_Sub1_Sub3 class50_sub1_sub3;
		synchronized (aDeque_1340) {
			class50_sub1_sub3 = (Class50_Sub1_Sub3) aDeque_1340.popFront();
		}
		if (!bool) {
			for (int i = 1; i > 0; i++) {
				/* empty */
			}
		}
		while (class50_sub1_sub3 != null) {
			aBoolean1338 = true;
			byte[] is = null;
			if ((aClient1373).aCacheIndexArray1228[0] != null) {
				is = ((aClient1373).aCacheIndexArray1228[((class50_sub1_sub3).anInt1467 + 1)]
					.method292(aByte1371, (class50_sub1_sub3).anInt1468));
			}
			if (!method341(
				is,
				764,
				(anIntArrayArray1377[(class50_sub1_sub3).anInt1467][((class50_sub1_sub3).anInt1468)]),
				(anIntArrayArray1344[(class50_sub1_sub3).anInt1467][((class50_sub1_sub3).anInt1468)]))) {
				is = null;
			}
			synchronized (aDeque_1340) {
				if (is == null) {
					aDeque_1351.method155(class50_sub1_sub3);
				} else {
					(class50_sub1_sub3).aByteArray1470 = is;
					synchronized (aDeque_1357) {
						aDeque_1357.method155(class50_sub1_sub3);
					}
				}
				class50_sub1_sub3 = (Class50_Sub1_Sub3) aDeque_1340.popFront();
			}
		}
	}

	public final void method339() {
		aBoolean1339 = false;
	}

	public final int method340(int i, int i_32_) {
		if (i_32_ != -31140) {
			aBoolean1380 = !aBoolean1380;
		}
		return anIntArrayArray1377[i].length;
	}

	private final boolean method341(byte[] is, int i, int i_33_, int i_34_) {
		i = 22 / i;
		if (is == null || is.length < 2) {
			return false;
		}
		int i_35_ = is.length - 2;
		int i_36_ = ((is[i_35_] & 0xff) << 8) + (is[i_35_ + 1] & 0xff);
		aCRC32_1354.reset();
		aCRC32_1354.update(is, 0, i_35_);
		int i_37_ = (int) aCRC32_1354.getValue();
		if (i_36_ != i_33_) {
			return false;
		}
		if (i_37_ != i_34_) {
			return false;
		}
		return true;
	}

	private final void method342(int i, Class50_Sub1_Sub3 class50_sub1_sub3) {
		try {
			if (i == 0) {
				try {
					if (aSocket1355 == null) {
						long l = System.currentTimeMillis();
						if (l - aLong1378 < 4000L) {
							return;
						}
						aLong1378 = l;
						aSocket1355 = aClient1373.method32(Client.anInt924 + 43594);
						anInputStream1370 = aSocket1355.getInputStream();
						anOutputStream1349 = aSocket1355.getOutputStream();
						anOutputStream1349.write(15);
						for (int i_38_ = 0; i_38_ < 8; i_38_++) {
							anInputStream1370.read();
						}
						anInt1353 = 0;
					}
					aByteArray1364[0] = (byte) ((class50_sub1_sub3).anInt1467);
					aByteArray1364[1] = (byte) (((class50_sub1_sub3).anInt1468) >> 8);
					aByteArray1364[2] = (byte) ((class50_sub1_sub3).anInt1468);
					if ((class50_sub1_sub3).aBoolean1471) {
						aByteArray1364[3] = (byte) 2;
					} else if (!aClient1373.aBoolean1137) {
						aByteArray1364[3] = (byte) 1;
					} else {
						aByteArray1364[3] = (byte) 0;
					}
					anOutputStream1349.write(aByteArray1364, 0, 4);
					anInt1375 = 0;
					anInt1379 = -10000;
				} catch (IOException ioexception) {
					try {
						aSocket1355.close();
					} catch (Exception exception) {
						/* empty */
					}
					aSocket1355 = null;
					anInputStream1370 = null;
					anOutputStream1349 = null;
					anInt1362 = 0;
					anInt1379++;
				}
			}
		} catch (RuntimeException runtimeexception) {
			Signlink.reporterror("78345, " + i + ", " + class50_sub1_sub3 + ", "
				+ runtimeexception.toString());
			throw new RuntimeException();
		}
	}

	public final int method343(int i) {
		i = 0 / i;
		return anIntArray1376.length;
	}

	public final int method344(int i, int i_39_, int i_40_, int i_41_) {
		if (i != 0) {
			return 1;
		}
		int i_42_ = (i_39_ << 8) + i_40_;
		for (int i_43_ = 0; i_43_ < anIntArray1346.length; i_43_++) {
			if (anIntArray1346[i_43_] == i_42_) {
				if (i_41_ == 0) {
					return anIntArray1360[i_43_];
				}
				return anIntArray1365[i_43_];
			}
		}
		return -1;
	}
}
